package com.xxxx.recv;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by HMF on 2021/08/16 19:07
 */
@Component
@RabbitListener(queues = "amqp_queue")  // 监听队列
public class RecvInit {

    // 监听之后获取消息的处理方法
    @RabbitHandler
    public void testRecv(String message) {
        System.out.println("接收到消息：" + message);
    }
}
